package com.cxx.purchasecharge.dal;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.cxx.purchasecharge.core.model.CustomerTypeCode;
import com.cxx.purchasecharge.core.model.persistence.Customer;
import com.cxx.purchasecharge.dal.common.MyGenericDao;

public interface CustomerDao extends MyGenericDao<Customer, Long> {
	
	public Customer findByShortName(String shortName);

	public int updateDealMoney(float dealMoney, long id);

	Page<Customer> findByFuzzy(CustomerTypeCode typeCode, Pageable pageable,
			String searchKey, long signUser, boolean admin);

	float countUnpayBy(CustomerTypeCode typeCode, String searchKey,
			long signUser, boolean admin);

	Page<Customer> findCustomerByFuzzy(Pageable pageable, String searchKey,
			long signUser, boolean admin);

	List<Customer> findAllCustomer(CustomerTypeCode typeCode, long signUser,
			boolean admin);

	boolean addDealMoney(float unpayMoney, long id);

	List<Customer> findByShortNameLike(String name, CustomerTypeCode code,
			long signUser, boolean admin);

}
